<template>
	<!-- scroll-view 滑动图 -->
	<view class="scroll" v-if="colIf == 1">
		<scroll-view scroll-x>
			<navigator :url="navUrl + item.id" v-for="(item,index) in scroll" :key="item.id" class="scroll-view">
				<!-- 相关图片 -->
				<image :class="['scroll-image',{mohu:item.episode}]" lazy-load :src="item.imageUrl"></image>
				<!-- 相关头部标签 和 上线日期-->
				<view class="scroll-year">{{item.releaseDate || item.biao}}</view>
				<!-- 比分 -->
				<view class="scroll-bifen" v-if="!item.releaseDate">
					<view>{{item.bifen}}</view>
					<view class="bifen-ji" v-if="item.episode">
						{{item.episode}}{{item.episodes == item.episode ? ' 集全' :' / ' + item.episodes + ' 集'  }}
					</view>
				</view>
				<!-- 即将发布内容 图片上带标题与类型 -->
				<view class="srcoll-title" v-if="item.releaseDate">
					<view class="title-cont">{{item.name}}</view>
					<view class="title-tags">
						<text v-for="tag in item.tags">{{tag.name}}&nbsp;&nbsp;</text>
					</view>
				</view>
				<!-- 下部带标题与标签 -->
				<view class="srcoll-content" v-if="!item.releaseDate">
					<view class="content-cont">{{item.name}}</view>
					<view class="content-tags">
						<text v-for="tag in item.tags">{{tag.name}}&nbsp;&nbsp;</text>
					</view>
				</view>


			</navigator>

			<!-- 	<view class="scroll-view">
				<view class="scroll-text">{{text}}</view>
			</view> -->
		</scroll-view>
	</view>


	<view class="scroll" v-if="colIf == 2">
		<scroll-view scroll-x>
			<navigator :url="navUrl + item.collection[0].id" v-for="(item,index) in scroll" :key="item.collection[0].id"
				class="scroll-view">
				<!-- 相关图片 -->
				<image :class="['scroll-image',{mohu:item.collection[0].episode}]" lazy-load
					:src="item.collection[0].imageUrl"></image>
				<!-- 相关头部标签 和 上线日期-->
				<view class="scroll-year">{{item.collection[0].releaseDate || item.collection[0].biao}}</view>
				<!-- 比分 -->
				<view class="scroll-bifen">
					<view>{{item.collection[0].bifen}}</view>
					<view class="bifen-ji" v-if="item.collection[0].episode">
						{{item.collection[0].episode}}{{item.collection[0].episodes == item.collection[0].episode ? ' 集全' :' / ' + item.collection[0].episodes + ' 集'  }}
					</view>
				</view>

				<!-- 下部带标题与标签 -->
				<view class="srcoll-content">
					<view class="content-cont">{{item.collection[0].name}}</view>
					<view class="content-tags">
						<text v-for="tag in item.collection[0].tags">{{tag.name}}&nbsp;&nbsp;</text>
					</view>
				</view>


			</navigator>

		</scroll-view>
	</view>


</template>

<script setup>
	defineProps({
		scroll: {
			type: Object,
			default: {}
		},
		tags: {
			type: Object,
			default: {}
		},
		navUrl: {
			type: String,
			default: ''
		},
		isIndex: {
			type: Boolean,
			default: true
		},
		colIf: {
			type: Number,
			default: 1
		}
	})
</script>

<style lang="scss" scoped>
	@import '@/uni.scss';

	.scroll {
		width: 100%;
		margin-left: 30rpx;

		scroll-view {
			white-space: nowrap;
		}

		scroll-view ::-webkit-scrollbar {
			width: 0;
			height: 0;
			color: transparent;
			display: none;
		}

		.scroll-view {
			width: 200rpx;
			height: 300rpx;
			display: inline-block;
			margin-right: 20rpx;

			.scroll-image {
				width: 100%;
				height: 100%;
				border-radius: 20rpx;
				background-color: #969696;
			}
			
			.scroll-view ::-webkit-scrollbar {
				width: 0;
				height: 0;
				color: transparent;
				display: none;
			}

			.mohu {
				-webkit-mask-image: linear-gradient(rgb(255, 255, 255), 90%, transparent);

			}

			.scroll-year {
				position: absolute;
				top: 0;
				font-size: 18rpx;
				font-weight: bold;
				background: rgba(0, 0, 0, 0.2);
				backdrop-filter: blur(20rpx);
				padding: 8rpx 15rpx;
				transform: scale(0.8);
				transform-origin: left top;
				border-top-left-radius: 20rpx;
				border-bottom-right-radius: 20rpx;
			}

			.scroll-bifen {
				width: 180rpx;
				position: absolute;
				display: flex;
				justify-content: space-between;
				top: 260rpx;
				padding: 0 10rpx;
				align-items: center;

				.bifen-ji {
					font-size: 18rpx;
				}

			}

			.srcoll-title {
				box-sizing: border-box;
				width: 200rpx;
				height: 100rpx;
				overflow: hidden;
				// border-radius: 0 0 20rpx 20rpx;
				padding: 10rpx 0;
				display: flex;
				flex-direction: column;
				align-items: center;
				text-align: center;
				z-index: 10;
				background: rgba(0, 0, 0, 0.1);
				backdrop-filter: blur(20rpx);
				position: absolute;
				bottom: 0;


				.title-cont {
					width: 90%;
					font-size: 20rpx;
					font-weight: bold;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
				}

				.title-tags {
					display: flex;
					flex-direction: row;
					flex-wrap: nowrap;
					font-size: 16rpx;
					color: $App-min-text-color;


				}
			}

			.srcoll-content {
				width: 200rpx;
				padding: 0 20rpx;

				.content-cont {
					width: 90%;
					font-size: 20rpx;
					font-weight: bold;
					overflow: hidden;
					white-space: nowrap;
					text-overflow: ellipsis;
				}

				.content-tags {
					display: flex;
					flex-wrap: nowrap;
					font-size: 16rpx;
					color: $App-min-text-color;

				}

			}


		}

		.scroll-view:last-child {
			padding-right: 35rpx;
		}
	}
</style>